//
// Copyright (c) 2011 Alex Nesterenko
//

#ifndef NANE_POSIX_FILESYSTEMIMPL__H
#   define  NANE_POSIX_FILESYSTEMIMPL__H

#   include "nane/core/crt/FileSystem.h"
#   include "nane/core/SubSystemProduct.h"

namespace nane
{
    class POSIXReadFile;
    class POSIXWriteFile;
    
    class FileSystem::Implementation
        : public IFileSystem
        , public SubSystemProductFactory<POSIXReadFile, FileSystem::Implementation, IReadFile>
        , public SubSystemProductFactory<POSIXWriteFile, FileSystem::Implementation, IWriteFile>    
    {
    public:
        Implementation();
        ~Implementation();

    public:
        bool initialize();
        void shutdown();
        IReadFile* openReadFile( const char* _filename );
        IWriteFile* openWriteFile( const char* _filename );
        bool exists( const char* _filename );
        bool deleteFile( const char* _filename );
        bool createFolder( const char* _path );
        bool deleteFolder( const char* _path );
        void release( POSIXReadFile* _posixReadFile );
        void release( POSIXWriteFile* _posixWriteFile );
    };
}

#endif	// NANE_POSIX_FILESYSTEMIMPL__H
